﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	x:Class="codejockey.BingPaper.MainWindow"
	Title="BingPaper"
	Width="763.2" Height="611" mc:Ignorable="d" ResizeMode="CanResizeWithGrip" MinWidth="763.2" MinHeight="611" Background="White" SnapsToDevicePixels="True" Loaded="WindowLoaded" Closing="WindowClosing">

	<Grid x:Name="LayoutRoot" DataContext="{Binding}">
		<Viewport3D HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="68.8" Height="68.8">
			<Viewport3D.OpacityMask>
				<DrawingBrush Viewbox="0,0,20,20" ViewboxUnits="Absolute">
					<DrawingBrush.Drawing>
						<DrawingGroup>
							<GeometryDrawing Brush="LightGray">
								<GeometryDrawing.Geometry>
									<RectangleGeometry Rect="0,0,20,20"/>
								</GeometryDrawing.Geometry>
							</GeometryDrawing>
							<GeometryDrawing Brush="Black">
								<GeometryDrawing.Geometry>
									<EllipseGeometry Center="0,0" RadiusX="10" RadiusY="10"/>
								</GeometryDrawing.Geometry>
							</GeometryDrawing>
							<GeometryDrawing Brush="Black">
								<GeometryDrawing.Geometry>
									<EllipseGeometry Center="20,20" RadiusX="10" RadiusY="10"/>
								</GeometryDrawing.Geometry>
							</GeometryDrawing>
							<GeometryDrawing Brush="White">
								<GeometryDrawing.Geometry>
									<EllipseGeometry Center="20,0" RadiusX="10" RadiusY="10"/>
								</GeometryDrawing.Geometry>
							</GeometryDrawing>
							<GeometryDrawing Brush="White">
								<GeometryDrawing.Geometry>
									<EllipseGeometry Center="0,20" RadiusX="10" RadiusY="10"/>
								</GeometryDrawing.Geometry>
							</GeometryDrawing>
						</DrawingGroup>
					</DrawingBrush.Drawing>
				</DrawingBrush>
			</Viewport3D.OpacityMask>
			<Viewport3D.Camera>
				<PerspectiveCamera FieldOfView="45" FarPlaneDistance="100" LookDirection="0,0,-24.142135623731" NearPlaneDistance="0.1" Position="0,0,24.142135623731" UpDirection="0,1,0"/>
			</Viewport3D.Camera>
			<ModelVisual3D x:Name="ModelContainer">
				<ModelVisual3D.Content>
					<GeometryModel3D x:Name="Model" d:Bounds="-10,-10,0,20,20,0">
						<GeometryModel3D.Material>
							<DiffuseMaterial>
								<DiffuseMaterial.Brush>
									<ImageBrush Stretch="Fill" ImageSource="BingPaper.png"/>
								</DiffuseMaterial.Brush>
							</DiffuseMaterial>
						</GeometryModel3D.Material>
						<GeometryModel3D.Geometry>
							<MeshGeometry3D Normals="0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1
0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1" Positions="-10,-10,0 -7.7777778,-10,0 -5.5555556,-10,0 -3.3333333,-10,0 -1.1111111,-10,0 1.1111111,-10,0 3.3333333,-10,0 5.5555556,-10,0 7.7777778,-10,0 10,-10,0 -10,-7.7777778,0 -7.7777778,-7.7777778,0 -5.5555556,-7.7777778,0
-3.3333333,-7.7777778,0 -1.1111111,-7.7777778,0 1.1111111,-7.7777778,0 3.3333333,-7.7777778,0 5.5555556,-7.7777778,0 7.7777778,-7.7777778,0 10,-7.7777778,0 -10,-5.5555556,0 -7.7777778,-5.5555556,0 -5.5555556,-5.5555556,0 -3.3333333,-5.5555556,0 -1.1111111,-5.5555556,0 1.1111111,-5.5555556,0
3.3333333,-5.5555556,0 5.5555556,-5.5555556,0 7.7777778,-5.5555556,0 10,-5.5555556,0 -10,-3.3333333,0 -7.7777778,-3.3333333,0 -5.5555556,-3.3333333,0 -3.3333333,-3.3333333,0 -1.1111111,-3.3333333,0 1.1111111,-3.3333333,0 3.3333333,-3.3333333,0 5.5555556,-3.3333333,0 7.7777778,-3.3333333,0
10,-3.3333333,0 -10,-1.1111111,0 -7.7777778,-1.1111111,0 -5.5555556,-1.1111111,0 -3.3333333,-1.1111111,0 -1.1111111,-1.1111111,0 1.1111111,-1.1111111,0 3.3333333,-1.1111111,0 5.5555556,-1.1111111,0 7.7777778,-1.1111111,0 10,-1.1111111,0 -10,1.1111111,0 -7.7777778,1.1111111,0
-5.5555556,1.1111111,0 -3.3333333,1.1111111,0 -1.1111111,1.1111111,0 1.1111111,1.1111111,0 3.3333333,1.1111111,0 5.5555556,1.1111111,0 7.7777778,1.1111111,0 10,1.1111111,0 -10,3.3333333,0 -7.7777778,3.3333333,0 -5.5555556,3.3333333,0 -3.3333333,3.3333333,0 -1.1111111,3.3333333,0
1.1111111,3.3333333,0 3.3333333,3.3333333,0 5.5555556,3.3333333,0 7.7777778,3.3333333,0 10,3.3333333,0 -10,5.5555556,0 -7.7777778,5.5555556,0 -5.5555556,5.5555556,0 -3.3333333,5.5555556,0 -1.1111111,5.5555556,0 1.1111111,5.5555556,0 3.3333333,5.5555556,0 5.5555556,5.5555556,0
7.7777778,5.5555556,0 10,5.5555556,0 -10,7.7777778,0 -7.7777778,7.7777778,0 -5.5555556,7.7777778,0 -3.3333333,7.7777778,0 -1.1111111,7.7777778,0 1.1111111,7.7777778,0 3.3333333,7.7777778,0 5.5555556,7.7777778,0 7.7777778,7.7777778,0 10,7.7777778,0 -10,10,0
-7.7777778,10,0 -5.5555556,10,0 -3.3333333,10,0 -1.1111111,10,0 1.1111111,10,0 3.3333333,10,0 5.5555556,10,0 7.7777778,10,0 10,10,0" TextureCoordinates="0,68.8 7.6444444,68.8 15.288889,68.8 22.933333,68.8 30.577778,68.8 38.222222,68.8 45.866667,68.8 53.511111,68.8 61.155556,68.8 68.8,68.8 0,61.155556 7.6444444,61.155556 15.288889,61.155556 22.933333,61.155556 30.577778,61.155556 38.222222,61.155556 45.866667,61.155556 53.511111,61.155556 61.155556,61.155556 68.8,61.155556 0,53.511111 7.6444444,53.511111 15.288889,53.511111
22.933333,53.511111 30.577778,53.511111 38.222222,53.511111 45.866667,53.511111 53.511111,53.511111 61.155556,53.511111 68.8,53.511111 0,45.866667 7.6444444,45.866667 15.288889,45.866667 22.933333,45.866667 30.577778,45.866667 38.222222,45.866667 45.866667,45.866667 53.511111,45.866667 61.155556,45.866667 68.8,45.866667 0,38.222222 7.6444444,38.222222 15.288889,38.222222 22.933333,38.222222 30.577778,38.222222 38.222222,38.222222
45.866667,38.222222 53.511111,38.222222 61.155556,38.222222 68.8,38.222222 0,30.577778 7.6444444,30.577778 15.288889,30.577778 22.933333,30.577778 30.577778,30.577778 38.222222,30.577778 45.866667,30.577778 53.511111,30.577778 61.155556,30.577778 68.8,30.577778 0,22.933333 7.6444444,22.933333 15.288889,22.933333 22.933333,22.933333 30.577778,22.933333 38.222222,22.933333 45.866667,22.933333 53.511111,22.933333 61.155556,22.933333
68.8,22.933333 0,15.288889 7.6444444,15.288889 15.288889,15.288889 22.933333,15.288889 30.577778,15.288889 38.222222,15.288889 45.866667,15.288889 53.511111,15.288889 61.155556,15.288889 68.8,15.288889 0,7.6444444 7.6444444,7.6444444 15.288889,7.6444444 22.933333,7.6444444 30.577778,7.6444444 38.222222,7.6444444 45.866667,7.6444444 53.511111,7.6444444 61.155556,7.6444444 68.8,7.6444444 0,0 7.6444444,0
15.288889,0 22.933333,0 30.577778,0 38.222222,0 45.866667,0 53.511111,0 61.155556,0 68.8,0" TriangleIndices="0 1 10 1 11 10 1 2 11 2 12 11 2 3 12 3 13 12 3 4 13 4 14 13 4 5 14 5 15 14 5 6 15 6 16 15 6 7 16 7 17 16 7 8 17 8 18 17 8 9 18 9 19 18 10 11 20 11 21 20 11 12 21 12 22 21 12 13 22 13 23 22 13 14 23 14 24 23 14 15 24 15 25 24 15 16 25 16 26 25 16 17 26 17 27 26 17 18 27 18 28 27 18 19 28 19 29 28 20 21 30 21 31 30 21 22 31 22 32 31 22 23 32 23 33 32 23 24 33 24 34 33 24 25 34 25 35 34 25 26 35 26 36 35 26 27 36 27 37 36 27 28 37 28 38 37 28 29 38 29 39 38 30 31 40 31 41 40 31 32 41 32 42 41 32 33 42 33 43 42 33 34 43 34 44 43 34 35 44 35 45 44 35 36 45 36 46 45 36 37 46 37 47 46 37 38 47 38 48 47 38 39 48 39 49 48 40 41 50 41 51 50 41 42 51 42 52 51 42 43 52 43 53 52 43 44 53 44 54 53 44 45 54 45 55 54 45 46 55 46 56 55 46 47 56 47 57 56 47 48 57 48 58 57 48 49 58 49 59 58 50 51 60 51 61 60 51 52 61 52 62 61 52 53 62 53 63 62 53 54 63 54 64 63 54 55 64 55 65 64 55 56 65 56 66 65 56 57 66 57 67 66 57 58 67 58 68 67 58 59 68 59 69 68 60 61 70 61 71 70 61 62 71 62 72 71 62 63 72 63 73 72 63 64 73 64 74 73 64 65 74 65 75 74 65 66 75 66 76 75 66 67 76 67 77 76 67 68 77 68 78 77 68 69 78 69 79 78 70 71 80 71 81 80 71 72 81 72 82 81 72 73 82 73 83 82 73 74 83 74 84 83 74 75 84 75 85 84 75 76 85 76 86 85 76 77 86 77 87 86 77 78 87 78 88 87 78 79 88 79 89 88 80 81 90 81 91 90 81 82 91 82 92 91 82 83 92 83 93 92 83 84 93 84 94 93 84 85 94 85 95 94 85 86 95 86 96 95 86 87 96 87 97 96 87 88 97 88 98 97 88 89 98 89 99 98"/>
						</GeometryModel3D.Geometry>
					</GeometryModel3D>
				</ModelVisual3D.Content>
			</ModelVisual3D>
			<ModelVisual3D x:Name="AmbientContainer">
				<ModelVisual3D.Content>
					<AmbientLight x:Name="Ambient" Color="Gray"/>
				</ModelVisual3D.Content>
			</ModelVisual3D>
			<ModelVisual3D x:Name="DirectionalContainer">
				<ModelVisual3D.Content>
					<DirectionalLight x:Name="Directional" Color="#FF7F7F7F" Direction="0,0,-1">
						<DirectionalLight.Transform>
							<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="3"/>
						</DirectionalLight.Transform>
					</DirectionalLight>
				</ModelVisual3D.Content>
			</ModelVisual3D>
		</Viewport3D>
		<Label Margin="80.8,10.65,0,0" VerticalAlignment="Top" Content="Bing" FontSize="29.333" FontWeight="Bold" HorizontalAlignment="Left" Width="72.393"/>
		<Label HorizontalAlignment="Left" Margin="96.723,42.576,0,0" VerticalAlignment="Top" Width="62.786" Content="Paper" FontSize="18.667" RenderTransformOrigin="0.5,0.5">
			<Label.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="-0.445"/>
					<TranslateTransform/>
				</TransformGroup>
			</Label.RenderTransform>
		</Label>
		<GroupBox Margin="26,0,25.6,11" Header="File &amp; Path Details" FontWeight="Bold" VerticalAlignment="Bottom" Height="195">
			<Label Content="255" FontSize="18.667" FontStyle="Italic" Background="#00524D4D" Foreground="#FFA19797" Height="42" Width="40.19" x:Name="lengthLabel" FontWeight="Normal" HorizontalAlignment="Right" Margin="0,0,9.866,-2.96" VerticalAlignment="Bottom" d:LayoutOverrides="HorizontalAlignment" />
		</GroupBox>
		<GroupBox Margin="0,67,23,0" Header="Wall Paper Details" FontWeight="Bold" HorizontalAlignment="Right" Width="195.4" VerticalAlignment="Top" Height="78.16">
			<Canvas>
				<CheckBox Content="Set as wall paper." Canvas.Left="8" Canvas.Top="8" FontWeight="Normal" x:Name="setAsWallPaperCheckBox" TabIndex="0" />
				<ComboBox Width="140.8" Canvas.Left="8" Canvas.Top="27.96" FontWeight="Normal" x:Name="wallpaperStyle" TabIndex="1">
					<ComboBoxItem Width="136" Height="17.6" Content="Stretched"/>
					<ComboBoxItem Content="Centered"/>
					<ComboBoxItem Content="Tiled"/>
				</ComboBox>
			</Canvas>
		</GroupBox>
		<TextBlock Margin="171.6,37.44,25.6,0" VerticalAlignment="Top" Text="BingPaper will download the current Bing image and set it as your wall paper." TextWrapping="Wrap" Height="22.227" FontStyle="Italic" FontSize="14.667"/>
		<Image Margin="26,95.2,243.8,223.8" RenderTransformOrigin="0.494,0.445" d:LayoutOverrides="HorizontalAlignment" x:Name="bingImage" Stretch="Fill" />
		<GroupBox Margin="0,143,23,322" Header="Valid Tokens" FontWeight="Bold" HorizontalAlignment="Right" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Width="195.4">
			<ListBox x:Name="tokenListBox" FontWeight="Normal" SelectedIndex="0" RenderTransformOrigin="0.5,0.5" Background="{x:Null}" ClipToBounds="True" HorizontalAlignment="Left" Margin="0,0.574,0,-0.574" Width="183.4" MouseDoubleClick="TokenListBoxMouseDoubleClick" TabIndex="2" />
		</GroupBox>
		<Button Margin="0,0,137,236" Click="ButtonClick" Content="Go" VerticalAlignment="Bottom" Height="26.36" x:Name="goButton" TabIndex="3" HorizontalAlignment="Right" Width="77" />
		<Label Content="File Path:" FontSize="18.667" FontWeight="Normal" HorizontalAlignment="Left" Margin="35.416,0,0,148" VerticalAlignment="Bottom" Height="34.83" Width="83.917" />
		<TextBox Text="" TextWrapping="Wrap" FontSize="18.667" Height="34.83" FontWeight="Normal" x:Name="filePathTextBox" TextChanged="FileNameTextBoxTextChanged" Margin="135.049,0,62.867,147" VerticalAlignment="Bottom" LostFocus="FilePathTextBoxLostFocus" Loaded="FilePathTextBoxLoaded" TabIndex="4" />
		<Label Content="The file path dictates where the current Bing image is stored. Tokens are available." FontStyle="Italic" FontWeight="Normal" Margin="135.52,0,170.867,124" VerticalAlignment="Bottom" Height="25.96" />
		<Label Content="File Name:" FontSize="18.667" Height="34.83" Width="96.38" FontWeight="Normal" HorizontalAlignment="Left" Margin="35.416,0,0,83" VerticalAlignment="Bottom" />
		<TextBox Height="34.83" FontSize="18.667" Text="" TextWrapping="Wrap" x:Name="fileNameTextBox" FontWeight="Normal" TextChanged="FileNameTextBoxTextChanged" Margin="141.07,0,84,83" VerticalAlignment="Bottom" LostFocus="FileNameTextBoxLostFocus" TabIndex="4" />
		<Label Content="The file name dictates the name to save the current Bing image as. Tokens are available." FontStyle="Italic" FontWeight="Normal" Margin="137.794,0,136.853,58.367" VerticalAlignment="Bottom" Height="25.96" />
		<Label Content="Result:" FontSize="18.667" FontWeight="Normal" HorizontalAlignment="Left" Margin="35.416,0,0,20" VerticalAlignment="Bottom" Height="34.83" Width="64.307" />
		<Label FontWeight="Normal" x:Name="resultantPathLabel" Margin="103.723,0,84.574,24" VerticalAlignment="Bottom" Height="25" />
		<Image HorizontalAlignment="Left" Margin="8,8,0,0" Width="77.6" Source="BingPaper.png" Stretch="Fill" VerticalAlignment="Top" Height="77.6" RenderTransformOrigin="0.147,0.272"/>
        <CheckBox Content="Auto Refresh" Margin="0,0,25,240" Name="autoRefreshCheckBox" Height="16" VerticalAlignment="Bottom" Click="AutoRefreshCheckBoxClick" HorizontalAlignment="Right" Width="86" />
        <ComboBox HorizontalAlignment="Right" Margin="0,0,23,203" Name="refreshIntervalComboBox" Width="127" Height="23" VerticalAlignment="Bottom" ToolTip="Format is in HH:MM:SS." SelectionChanged="RefreshIntervalComboBoxSelectionChanged" />
        <Label Content="Interval:" Margin="0,0,156,199" Name="label1" Height="28" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="57" />
        <Label Content="Refresh:" Margin="26,0,0,202" Name="refreshCountdownLabel" Visibility="Hidden" FontStyle="Normal" FontStretch="Normal" HorizontalAlignment="Left" Width="231" Height="28" VerticalAlignment="Bottom" Foreground="Black" FontWeight="Normal" ForceCursor="True" BorderBrush="Black" />
        <GroupBox Header="Country" Height="59" Margin="0,0,24,264" Name="groupBox1" VerticalAlignment="Bottom" FontWeight="Bold" Width="196" HorizontalAlignment="Right">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="109*" />
                    <ColumnDefinition Width="74*" />
                </Grid.ColumnDefinitions>
                <ComboBox Height="23" HorizontalAlignment="Left" Margin="6,6,0,0" Name="countryCodesComboBox" VerticalAlignment="Top" Width="169" Grid.ColumnSpan="2" FontWeight="Normal" SelectionChanged="CountryCodesComboBoxSelectionChanged" IsReadOnly="False" />
            </Grid>
        </GroupBox>
        <Slider HorizontalAlignment="Right" Margin="0,0,244,199" Name="daySlider" Width="116" Interval="1" Maximum="7" IsMoveToPointEnabled="True" IsSnapToTickEnabled="True" ValueChanged="DaySliderValueChanged" Height="23" VerticalAlignment="Bottom" />
    </Grid>
</Window>